package com.CST.mapper.dataplatform;

import com.CST.entity.cb.BdOrganization;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BdOrganizationMapper extends BaseMapper<BdOrganization> {

    /**
     * 子级成本科室跟核算科室对应关系
     * @param entity
     * @return
     */
    List<BdOrganization> getOrganizationSource(BdOrganization entity);

    /**
     * 父级成本科室跟核算科室对应关系
     * @param entity
     * @return
     */
    List<BdOrganization> getOrganizationSourceParent(BdOrganization entity);

    List<BdOrganization> getOrganizationNormal(BdOrganization entity);

    List<BdOrganization> isHaveOrganization(BdOrganization entity);

    void addOrganization(BdOrganization entity);

    void modifyOrganization(BdOrganization entity);

    void batchDeleteOrganization(List<Integer> ids);
    
    int addOrganizationWithList(List<BdOrganization> bdOrganizationList);

    /**
     * 获取科室对应关系
     * @param yard
     * @return
     */
    List<BdOrganization> listParentDeptGroup(String yard);

    /**
     * 获取所有临床类科室
     * @param yard
     * @return
     */
    List<BdOrganization> listClinicalDeptGroup(String yard);

    List<BdOrganization> listSpecial(Integer starYear,Integer starMonth,Integer endYear,Integer endMonth );

    /**
     * 传入父级科室/子级科室
     * 获取其组织架构关系，包含科室类型（住院，门诊，医技，医辅，行政）
     */
    List<BdOrganization> listGroupByDeptAndPDeptWithType(@Param("pDeptCode") String pDeptCode,@Param("deptCode") String deptCode);


    List<BdOrganization>  listNoBdOrganization();


}
